package com.javaspeak.designpatterns.go4.behavioural.memento;

/**
 * This interface describes document editing functionality such as saving the
 * document text, font family and font size.
 * <p>
 * This interface extends the Originator interface which has additional methods
 * like:
 * <pre>
 * {@code
 * public Memento getMemento();
 * public void restoreFromMemento( Memento memento );
 * }
 * </pre>
 * The Document interface is implemented by the Originator.
 * When the getMemento() method is called on the Document the Document returns
 * a snapshot of its state in a DocumentMemento object.
 * <p>
 * When the restoreFromMemento(..) is called on the Document the Document will
 * roll back its state to the state encapsulated in the DocumentMemento object.
 *
 * @author John Dickerson
 */
public interface Document extends Originator {

    public void saveDocumentText( String documentText );

    public String getDocumentText();

    public void saveFontFamily( String fontFamily );

    public String getFontFamily();

    public void saveFontSize( int fontSize );

    public int getFontSize();
}
